#!/usr/bin/python
# -*- coding:utf-8 -*-
# @FileName : servey.py
# Author    : myh

class AnonymousSurvey:
    """收集匿名调查问卷的答案"""
    def __init__(self, question):
        """存储一个问题，并为存储答案做准备"""
        self.question = question
        self.responses = []

    def show_question(self):
        """显示调查问卷"""
        print(self.question)

    def store_response(self, new_response):
        """存储单份调查答卷"""
        self.responses.append(new_response)

    def show_results(self):
        """显示收集到的所有答卷"""
        print("Survey results:")
        for response in self.responses:
            print(f"- {response}")


# language_servey = AnonymousSurvey('What is your favourite language')
#
# language_servey.show_question()
# while True:
#     response = input("language(press 'q' to quit): ")
#     if response != 'q':
#         language_servey.store_response(response)
#     else:
#         break
#
# language_servey.show_results()

